{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "9fe819e5ad91417ebbec2f4b5c5e8241",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Plot(antialias=3, axes=['\\\\sum_i x_i', 'y', 'z'], background_color=16777215, camera=[4.5, 4.5, 4.5, 0.0, 0.0, …"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "from vtkplotter import *\n",
    "import numpy as np\n",
    "\n",
    "#embedWindow(False) #uncomment to pop the usual vtk rendering window, press Esc to close it.\n",
    "\n",
    "positions = np.random.randn(5000,3)\n",
    "scalars = np.sum(positions, axis=1)\n",
    "\n",
    "plot = Plotter()\n",
    "plot.xtitle = '\\sum_i x_i'\n",
    "\n",
    "points = Points(positions)\n",
    "\n",
    "# color vertices based on their scalar value with any matplotlib color map\n",
    "points.pointColors(scalars, cmap='coolwarm')\n",
    "plot += points\n",
    "\n",
    "plot.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "closePlotter()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
